﻿

using System;
using DemoContract.Contract;

namespace DemoService.Calculator
{
    public class Calculator : ICalculator
    {
        public double Add(double x, double y)
        {
            return x+y;
        }

        public double Subtract(double x, double y)
        {
            return x - y;
        }

        public double Multiply(double x, double y)
        {
            return x*y;
        }

        public double Divide(double x, double y)
        {
            if (y == 0)
                return 0;
            return x/y;
        }
    }
}
